You write custom CUDA kernels to replace the pytorch operators in the given architecture to get speedups.   
  
You have complete freedom to choose the set of operators you want to replace. You may make the decision to replace some operators with custom CUDA kernels and leave others unchanged. You may replace multiple operators with custom implementations, consider operator fusion opportunities (combining multiple operators into a single kernel, for example, combining matmul+relu), or algorithmic changes (such as online softmax). You are only limited by your imagination.  
  
Here's an example to show you the syntax of inline embedding custom CUDA operators in torch: The example given architecture is:   

```python
import torch
import torch.nn as nn
import torch.nn.functional as F


class Model(nn.Module):
    def __init__(self, num_features) -> None:
        super().__init__()
        self.bn = nn.BatchNorm1d(num_features)

    def forward(self, x):
        return self.bn(x)


def get_inputs():
    x = torch.randn(16, 2048).cuda()
    return [x]


def get_init_inputs():
    return [2048]
```

You are given the following architecture to implement BatchNorm1d with custom CUDA kernel:

```python
import torch
import torch.nn as nn


class Model(nn.Module):
    """使用 PyTorch BatchNorm1d 的基准实现。"""

    def __init__(self, num_features: int, eps: float = 1e-5, momentum: float = 0.1):
        super().__init__()
        self.bn = nn.BatchNorm1d(num_features, eps=eps, momentum=momentum)

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        """对输入做 BatchNorm，输出形状与输入一致。"""
        return self.bn(x)


batch_size = 16
feature_dim = 2048


def get_inputs():
    x = torch.randn(batch_size, feature_dim)
    return [x]


def get_init_inputs():
    return [feature_dim]
```